package cus1156.lab6;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class CatListTest {
    private CatList list;
    
	@Before
	public void setUp() throws Exception {
		list = new CatList();
	}

	@Test
	public void testAddCat() {
		list.addCat(new Cat("Joe", "orange"));
		list.addCat(new Cat("Fluffy", "calico"));
		assertEquals(list.getCatAtPos(0).getName(), "Joe");
		assertEquals(list.getCatAtPos(1).getName(), "Fluffy");
	}

	@Test
	public void testHowManyCats() {
		list.addCat(new Cat());
		list.addCat(new Cat());
		assertEquals(list.howManyCats(),2);
		list.addCat(new Cat());
		assertEquals(list.howManyCats(),3);
	}
	
	@Test
	public void whatColorCat() {
		list.addCat(new Cat("Joe", "orange"));
		list.addCat(new Cat("Fluffy", "calico"));
		assertEquals(list.whatColorCat(0), 'O');
		assertEquals(list.whatColorCat(1), 'C');
	}
	}
	@Test
	public void getCatByName(){
		list.addCat(new Cat("Joe", "orange"));
		list.addCat(new Cat("Fluffy", "calico"));
		assertEquals(list.getCatByName("Joe"));
		assertEquals(list.getCatByName("Fluffy"));
		assertEquals(list.getCatByName("Grumpy"));
	}
}
